#include <bits/stdc++.h>

using namespace std;
int gcd1(int a,int b)
{
    int c;
    if (b==0)
    {
        return a;
    }
    while ((c=a%b)!=0)
    {
        a=b;
        b=c;
    }
    return b;
}
int gcd2(int a,int b)
{
    return !b?a:gcd2(b,a%b);
}
int main_117()
{
    printf("%d\n",gcd1(6,0));
    printf("%d",gcd2(0,6));
    return 0;
}
